function(target_sources_if_not_overridden filename)
    list(FIND TX_SRC_OVERRIDES ${filename} OVERRIDE_FOUND)
    if( OVERRIDE_FOUND EQUAL -1 )
        # message(STATUS "** Using original ${filename} from StdPeriphDriver **")
        target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/${filename})
    endif()
endfunction()

target_sources(
    ${PROJECT_NAME}
    PRIVATE
	# {{BEGIN_TARGET_SOURCES}}

	${CMAKE_CURRENT_LIST_DIR}/CH57x_adc.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_clk.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_flash.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_gpio.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_int.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_lcd.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_pwm.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_pwr.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_spi0.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_spi1.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_sys.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_timer0.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_timer1.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_timer2.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_timer3.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_uart0.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_uart1.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_uart2.c
	${CMAKE_CURRENT_LIST_DIR}/CH57x_uart3.c

    # {{END_TARGET_SOURCES}}
)	 
# Add the Common/inc directory to the project include list
target_include_directories(${PROJECT_NAME} 
    PUBLIC 
    ${CMAKE_CURRENT_LIST_DIR}/inc
)
